package com.woniuxy.qiantai.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.qiantai.entity.Type;
import com.woniuxy.qiantai.mapper.ShopMapper;
import com.woniuxy.qiantai.mapper.TypeMapper;
import com.woniuxy.qiantai.service.TypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author firstGroup
 * @since 2023-02-22 09:45:58
 */
@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements TypeService {
    @Autowired
    TypeMapper typeMapper;
    @Autowired
    ShopMapper shopMapper;

    @Override
    public List<Type> selectTypeByShopId(Integer shopId) {//通过商家id查询标签信息
        QueryWrapper<Type> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("shop_id",shopId);
        List<Type> typeList = typeMapper.selectList(queryWrapper);
        return typeList;
    }
//    @Override
//    public List<Type> selectShopByFoodType(String foodType) {//通过商家id查询标签信息
//        QueryWrapper<Type> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("type_name",foodType);
//        List<Type> typeList = typeMapper.selectList(queryWrapper);
//        return typeList;
//    }
}
